#ifndef __CONSOLETASK_H_
#define __CONSOLETASK_H_
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include <stdint.h>
#include <stdbool.h>
#include "cType.h"

#define ARG_LEN     10
#define CMD_LEN     20
#define CMD_BUF_LEN 60
#define ARG_NUM		4

typedef struct {
    bool argexist;
    int8_t argNum;
    uint8_t cmd_name[CMD_LEN];
    uint8_t cmd_arg[ARG_NUM][ARG_LEN];
}cmd_analyze_T;

typedef enum {
    Console_Mode=0,
    AP_Mode,
    Ignor_Mode
}CMD_MODE_T;
extern CMD_MODE_T CmdMode;

typedef enum {
    APMode_HeadH,
    APMode_HeadL,
    APMode_CmdType,
    APMode_Cmd,
    APMode_EndH,
    APMode_EndL
}APMode_T;
extern APMode_T APMode;
typedef struct {
    char const *cmd_name;
    int32_t max_args;
    void (*handle)(int argc, void *cmd_arg[]);
    char  *help;
}cmd_list_T;

void ConsoleTask(void);
uint8_t ConsoleTxt2hex(uint8_t *data);

#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

